package com.sumainfor.pc.gmio.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.impl.market.BillOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 功能描述:
 *
 * @Auther: zhlu
 * @Date: 2019/4/1 12:16
 * @Description:
 */
@RestController
@RequestMapping("/bill")
public class testBillOwnerController {

    @Autowired
    BillOwnerService BillOwnerService;


    /**
     * 功能描述:
     * 根据业主合同资料生成唐巢支付业主的账单
     * 1.新业主收房信息补全之前生成。
     * 2.续签业主在第一份合同到期之后定时任务生成
     *
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/3/25 10:42
     */
    @ResponseBody
    @PostMapping("/AddBillOwner")
    public JsonResult AddBillOwner(@RequestBody Map<String, Object> params) throws Exception {
        JsonResult result = new JsonResult();
        if (BillOwnerService.AddBillOwner(params)) {
            result.putSuccess("业主账单录入成功！");
        } else {
            result.putFailed("服务器繁忙，请稍后重试！");
        }
        return result;
    }

}
